// *********************
// NSC benutzt Ore-Mobsi
// *********************

FUNC VOID ZS_Pick_Ore ()
{
	Perception_Set_Normal();
	self.AIVAR[AIV_TAPOSITION] = NOTINPOS;

	B_ResetAll (self);
	
	self.AIVAR[AIV_TAPOSITION] = 0;

	AI_SetWalkmode (self, NPC_RUN);
	
	AI_RemoveWeapon(self);

	if (Hlp_StrCmp (Npc_GetNearestWP(self), self.wp) == FALSE)
    {
		AI_GotoWP	(self, self.wp);
	};
	if (Npc_HasItems (self,ItMw_2H_Axe_L_01) == 0)
	{
		CreateInvItem (self,ItMw_2H_Axe_L_01);
	};

	EquipItem (self,ItMw_2H_Axe_L_01);
};

FUNC int ZS_Pick_Ore_Loop ()
{
	// ------ Erz Picken ------
	if (!C_BodyStateContains(self, BS_MOBINTERACT_INTERRUPT))
	&& (Wld_IsMobAvailable(self,"ORE"))
	{
		self.AIVAR[AIV_TAPOSITION] = ISINPOS;
		AI_UseMob (self, "ORE", 1);
		
		if (Hlp_GetInstanceID (self) == PAL_1070_MinenArbeiterSoeldner)
		{
			B_SetBigMineActiveWorker(RED,B_GetBigMineActiveWorker(RED)+1);
		};
		if (Hlp_GetInstanceID (self) == DJG_2070_MinenArbeiterSoeldner)
		{
			B_SetBigMineActiveWorker(BLUE,B_GetBigMineActiveWorker(BLUE)+1);
		};
	};

	return LOOP_CONTINUE;
};

FUNC VOID ZS_Pick_Ore_End ()
{
	if (Hlp_GetInstanceID (self) == PAL_1070_MinenArbeiterSoeldner)
	{
		B_SetBigMineActiveWorker(RED,B_GetBigMineActiveWorker(RED)-1);
	};
	if (Hlp_GetInstanceID (self) == DJG_2070_MinenArbeiterSoeldner)
	{
		B_SetBigMineActiveWorker(BLUE,B_GetBigMineActiveWorker(BLUE)-1);
	};
	self.AIVAR[AIV_TAPOSITION] = NOTINPOS;
	AI_UseMob (self, "ORE", -1);
};
